package com.sz.app.oss.api.system;

import com.sz.common.base.dto.ResultDto;
import com.sz.common.core.system.entity.SysDict;
import com.sz.common.core.system.service.SysDictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Function: 职位<br>
 * Author: wentao.chang <br>
 * Date: 2016-11-08 10:27:00
 */
@Controller
@RequestMapping("/api/v1/sys/positions")
@Api(description = " ", tags = "003_1、职位")
public class PositionController {

    @Autowired
    private SysDictService dictService;

    /**
     * 获取职位列表
     *
     * @throws Exception
     */
    @ApiOperation(value = "获取职位列表", notes = "")
    @RequestMapping(value = "", method = {RequestMethod.GET})
    public
    @ResponseBody
    ResultDto findAll() throws Exception {
        List<SysDict> dictList = dictService.findByCatalog("sys.user.position");
        ResultDto dto = new ResultDto();
        dto.setData(dictList);
        return dto;
    }
}
